home *** CD-ROM | disk | FTP | other *** search
- import vrml.BaseNode;
- import vrml.Event;
- import vrml.field.ConstSFBool;
- import vrml.field.SFColor;
- import vrml.field.SFInt32;
- import vrml.node.Script;
-
- public class chgclr extends Script {
- SFColor diffuse;
- // $FF: renamed from: no vrml.field.SFInt32
- SFInt32 field_0;
- // $FF: renamed from: f float[]
- float[] field_1 = new float[3];
- final int COLOR_MAX = 18;
-
- public void processEvent(Event var1) {
- if (((ConstSFBool)var1.getValue()).getValue()) {
- String var2 = var1.getName();
-
- try {
- if (var2.startsWith("clicked")) {
- Integer var3 = new Integer(var2.substring(7));
- int var4 = var3;
- if (var4 >= 0 && var4 < 18) {
- this.diffuse.setValue(GenerateColor.getSFColor(var4));
- this.field_0.setValue(var4);
- return;
- }
- } else {
- ((BaseNode)this).getBrowser().setDescription("invalid header:" + var2);
- }
-
- } catch (Exception var5) {
- ((BaseNode)this).getBrowser().setDescription("error: wrl file is not correct.");
- }
- }
- }
-
- public void initialize() {
- this.diffuse = (SFColor)((Script)this).getEventOut("diffuse");
- this.field_0 = (SFInt32)((Script)this).getEventOut("no");
- }
- }
-